package com.skzh.customized.service.impl;

import com.skzh.common.core.domain.model.LoginUser;
import com.skzh.common.utils.DateUtils;
import com.skzh.common.utils.SecurityUtils;
import com.skzh.customized.domain.PcCustomized;
import com.skzh.customized.mapper.PcCustomizedMapper;
import com.skzh.customized.service.IPcCustomizedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author zr
 * @Description pc端定制基本信息Service接口实现类
 * @Date 2025/3/21 16:05
 */
@Service
public class PcCustomizedServiceImpl implements IPcCustomizedService {


    @Autowired
    private PcCustomizedMapper pcCustomizedMapper;

    /**
     * 查询pc端定制基本信息
     *
     * @param pcCustomized pc端定制基本信息
     * @return pc端定制基本信息集合
     */
    @Override
    public List<PcCustomized> selectPcList(PcCustomized pcCustomized) {
        List<PcCustomized> pcCustomizedList = pcCustomizedMapper.selectPcCustomizedList(pcCustomized);
        return pcCustomizedList;
    }


    /**
     * 修改pc定制基本信息
     *
     * @param pcCustomized pc定制基本信息
     * @return 结果
     */
    @Override
    public int updatePc(PcCustomized pcCustomized) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        pcCustomized.setUpdateBy(loginUser.getUsername());
        pcCustomized.setUpdateTime(DateUtils.getNowDate());
        return pcCustomizedMapper.updatePcCustomized(pcCustomized);
    }


}
